import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-12-16
 * Time:19:49
 */
public class Test {
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int d=scanner.nextInt();
        //A-B=a.B-C=b,A+B=c,B+C=d
        //A=(a+c)/2
        //B=(b+d)/2=(c-a)/2
        //C=(d-b)/2
        int A=(a+c)/2;
        int B=(b+d)/2;
        int C=(d-b)/2;
        if(B==(c-a)/2){
            System.out.println(A+" "+B+" "+C);
        }else{
            System.out.println("No");
        }
    }

    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int m=scanner.nextInt();
        int n= scanner.nextInt();
        String table="0123456789ABCDEF";
        Boolean flag=false;
        if(m<0){
            m=-m;
            flag=true;
        }
        StringBuilder ret=new StringBuilder();
        while(m!=0){
            ret.append(table.charAt(m%n));
            m=m%n;
        }
        if(flag){
            ret.append("-");
        }
        ret.reverse();
        System.out.println(ret);
    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String ret1=scanner.nextLine();
        String ret2=scanner.nextLine();
        int length=ret1.length();
        int sum=0;
        for (int i = 0; i <= length; i++) {
            StringBuilder str=new StringBuilder(ret1);
            str.insert(i,ret2);
            StringBuilder str2=str;
            str2=str2.reverse();
            if(str.toString().equals(str2.toString())){
                sum++;
            }
        }
        System.out.println(sum);
    }
}
